#include "CommInputDialog.h"
#include "ui_CommInputDialog.h"

CommInputDialog::CommInputDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::CommInputDialog)
{
    ui->setupUi(this);
    setWindowTitle("对话框");
}

CommInputDialog::~CommInputDialog()
{
    delete ui;
}

void CommInputDialog::SetPrompt(QString name)
{
    ui->lineEdit->setText("");
    ui->label->setText(name);
}

void CommInputDialog::SetDefalutValue(QString value)
{
    ui->lineEdit->setText(value);
}

QString CommInputDialog::GetInputText()
{
    return ui->lineEdit->text();
}

void CommInputDialog::on_pushButton_clicked()
{
    accept();
}

void CommInputDialog::on_pushButton_2_clicked()
{
    close();
}
